<?php
/*
EasyMeal is a sample PHP+CakePHP+Sqlite meal order program.
Copyright (C) 2008 iworm

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
class AdminController extends AppController{
    var $name = 'Admin';
    var $uses = array('People', 'Shop', 'Food', 'Order');
    //var $helpers = array('javascript');
    function index(){
        if($this->Session->read('islogin'))
        {
            $this->redirect('/order/view/?peopleId=all');
            exit(0);
        }
        $this->set('isLogin', 0);
    }

    function login(){
        $username = $this->params['form']['username'];
        $password = md5($this->params['form']['password']);

        $user = $this->People->find('all', array(
            'conditions' => array('People.name' =>  $username),
            'recursive' => 0
        ));

        if(count($user) > 0 && $user[0]['People']['password'] == $password && $user[0]['People']['admin'])
        {
            $this->Session->write('islogin', '1');
            $this->redirect('/order/view/?peopleId=all');
            exit(0);
        }
        else
        {
            $this->set(array(
                'msg' => '用户名/密码错误'
            ));
        }
    }

    function logout(){
        $this->Session->write('islogin', '0');
        $this->redirect('/order');
    }

    function initShopAndFood(){
        if(!$this->Session->read('islogin'))
        {
            $this->redirect('/admin');
            exit(0);
        }

        $this->redirect('/');
        exit(0);

        $this->set('isLogin', 1);

        $this->Shop->deleteAll(array(
            '1' => '1'
        ));

        $this->Food->deleteAll(array(
            '1' => '1'
        ));

        //////////////////////////////////////////////////////////////////////////////
        //深德广东美食
        //////////////////////////////////////////////////////////////////////////////
        $this->Shop->create();
        $this->Shop->save(array(
            'id' => '1',
            'name' => '深德',
            'address' => '大木桥路',
            'phone' => '12345678',
            'note' => ''
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '2',
            'name' => '咸鱼肉粒茄子',
            'price' => '11',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '3',
            'name' => '榄菜肉碎四季豆',
            'price' => '11',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '4',
            'name' => '豉椒鲫鱼',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '5',
            'name' => '滑蛋牛肉',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '6',
            'name' => '滑蛋叉烧',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '7',
            'name' => '深德阳江姜豉五花肉',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '8',
            'name' => '深德豉汁排骨',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '9',
            'name' => '蜜汁叉烧',
            'price' => '15',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '10',
            'name' => '黑椒洋葱牛肉',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '11',
            'name' => '沙姜鸡',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '12',
            'name' => '白切鸡',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '13',
            'name' => '盐局鸡',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '14',
            'name' => '烧鹅',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '15',
            'name' => '脆皮烧肉',
            'price' => '15',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '16',
            'name' => '豉油皇豆干五花肉',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '17',
            'name' => '沙茶芥兰牛肉',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '18',
            'name' => '深德牛腩',
            'price' => '13',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '19',
            'name' => '烧鹅腿',
            'price' => '16',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '20',
            'name' => '烧味双拼',
            'price' => '18',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '21',
            'name' => '滑蛋虾仁',
            'price' => '16',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '22',
            'name' => '美极罗氏虾',
            'price' => '18',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '23',
            'name' => '牛腩汤河粉',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '24',
            'name' => '潮式鱼蛋汤河粉',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '25',
            'name' => '潮式牛丸汤河粉',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '26',
            'name' => '叉烧汤河粉',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '27',
            'name' => '烧鹅汤河粉',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '28',
            'name' => '潮式鱼蛋公仔面',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '29',
            'name' => '潮式牛丸公仔面',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '30',
            'name' => '双丸汤河粉',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '31',
            'name' => '潮式双丸公仔面',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '32',
            'name' => '干炒牛河',
            'price' => '14',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '33',
            'name' => '叉烧炒河',
            'price' => '14',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '34',
            'name' => '黑椒牛肉炒饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '35',
            'name' => '腊味芥兰炒饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '36',
            'name' => '荷兰豆叉烧炒饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '37',
            'name' => '广州炒饭',
            'price' => '16',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '38',
            'name' => '白粥',
            'price' => '3',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '39',
            'name' => '皮蛋瘦肉粥',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '40',
            'name' => '咸蛋麦菜肉碎粥',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        //////////////////////////////////////////////////////////////////////////////
        //艺厨便当
        //////////////////////////////////////////////////////////////////////////////
        $this->Shop->create();
        $this->Shop->save(array(
            'id' => '41',
            'name' => '艺厨',
            'address' => '天钥桥路815号(靠近零陵路)',
            'phone' => '64865450/54243750/13917725256',
            'note' => '15元起送/订任意餐品均赠送水果一份或汤/10元起送酸奶/满60元送大瓶可乐或雪碧1瓶/5份以上可以周结或半月结'
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '42',
            'name' => '腊味炒饭',
            'price' => '7',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '43',
            'name' => '扬州炒饭',
            'price' => '7',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '44',
            'name' => '青椒炒蛋餐',
            'price' => '8',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '45',
            'name' => '干煸四季豆餐',
            'price' => '8',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '46',
            'name' => '洋葱炒蛋餐',
            'price' => '8',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '47',
            'name' => '雪菜炒蛋餐',
            'price' => '8',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '48',
            'name' => '肉末茄子餐',
            'price' => '8',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '49',
            'name' => '肉末酸豆角餐',
            'price' => '8',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '50',
            'name' => '西红柿炒蛋餐',
            'price' => '8',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '51',
            'name' => '麻婆豆腐餐',
            'price' => '8',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '52',
            'name' => '雪菜肉丝餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '53',
            'name' => '热狗跑蛋餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '54',
            'name' => '红烧鱼块餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '55',
            'name' => '咖喱鸡餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '56',
            'name' => '青椒肉丝餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '57',
            'name' => '湖北小炒肉餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '58',
            'name' => '回锅肉餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '59',
            'name' => '川椒鸡餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '60',
            'name' => '香肠跑蛋餐',
            'price' => '9',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '61',
            'name' => '椒盐排条餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '62',
            'name' => '洋葱牛柳餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '63',
            'name' => '大排饭餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
	$this->Food->create();
        $this->Food->save(array(
            'id' => '64',
            'name' => '耗油牛肉餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
	$this->Food->create();
        $this->Food->save(array(
            'id' => '65',
            'name' => '黑椒牛柳餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
	$this->Food->create();
        $this->Food->save(array(
            'id' => '66',
            'name' => '红烧鸭腿餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '67',
            'name' => '土豆烧肉餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '68',
            'name' => '红烧狮子头餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '69',
            'name' => '密制鸡腿餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '70',
            'name' => '梅菜烧肉餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '71',
            'name' => '萝卜烧鸭餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '72',
            'name' => '木耳肉片餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '73',
            'name' => '爆炒大肠餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '74',
            'name' => '宫爆鸡丁餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '75',
            'name' => '辣子鸡丁餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '76',
            'name' => '西芹腊肉餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '77',
            'name' => '香菇仔鸡餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '78',
            'name' => '百叶结烧肉餐',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '79',
            'name' => '咖喱牛腩餐',
            'price' => '11',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '80',
            'name' => '香脆鸡腿餐',
            'price' => '11',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '81',
            'name' => '萝卜牛腩餐',
            'price' => '11',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '82',
            'name' => '腊鸡腿餐',
            'price' => '11',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '83',
            'name' => '干炒牛河餐',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '84',
            'name' => '豆豉排骨餐',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '85',
            'name' => '萝卜排骨餐',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '86',
            'name' => '茶树菇烤肉餐',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '87',
            'name' => '秘制烤鸭餐',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '88',
            'name' => '茶树菇腊肉餐',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));
		
        $this->Food->create();
        $this->Food->save(array(
            'id' => '89',
            'name' => '干烧骨酥鲫鱼餐',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        //////////////////////////////////////////////////////////////////////////////
        //御品便当
        //////////////////////////////////////////////////////////////////////////////
        $this->Shop->create();
        $this->Shop->save(array(
            'id' => '90',
            'name' => '御品',
            'address' => '',
            'phone' => '54486686/64365787',
            'note' => '所有便当一律送水果/12元以上送酸奶或水果/10份以上送大瓶可乐'
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '91',
            'name' => '深海牛排饭',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '92',
            'name' => '牛肉炒面',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '93',
            'name' => '牛肉河粉',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '94',
            'name' => '鱼香肉丝饭',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '95',
            'name' => '辣子鸡丁饭',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '96',
            'name' => '咖喱鸡块饭',
            'price' => '10',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '97',
            'name' => '板栗鸡块饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '98',
            'name' => '香酥排骨饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '99',
            'name' => '特色嫩排饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '100',
            'name' => '黑胡椒猪排饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '101',
            'name' => '红烧带鱼饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '102',
            'name' => '脆皮鸡腿饭',
            'price' => '14',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '103',
            'name' => '糖醋排条饭',
            'price' => '12',
            'shopId' => $this->Shop->id
        ));

        $this->Food->create();
        $this->Food->save(array(
            'id' => '104',
            'name' => '秘制红烧肉饭',
            'price' => '15',
            'shopId' => $this->Shop->id
        ));
    }

    function initPeople(){
        if(!$this->Session->read('islogin'))
        {
            $this->redirect('/admin');
            exit(0);
        }

        $this->redirect('/');
        exit(0);

        $this->set('isLogin', 1);

        $this->People->deleteAll(array(
            '1' => '1'
        ));

        //1
        $this->People->create();
        $this->People->save(array(
            'id' => '1',
            'name' => 'Bruce Gu',
            'email' => 'bgu2@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //2
        $this->People->create();
        $this->People->save(array(
            'id' => '2',
            'name' => 'Chase Sun',
            'email' => 'csun@cdcsoftware.com',
            'password' => 'e0323a9039add2978bf5b49550572c7c',
            'admin' => '1'
        ));

        //3
        $this->People->create();
        $this->People->save(array(
            'id' => '3',
            'name' => 'Coco Lin',
            'email' => 'clin@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //4
        $this->People->create();
        $this->People->save(array(
            'id' => '4',
            'name' => 'Echo Chen',
            'email' => 'echen@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //5
        $this->People->create();
        $this->People->save(array(
            'id' => '5',
            'name' => 'Eva He',
            'email' => 'ehe2@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //6
        $this->People->create();
        $this->People->save(array(
            'id' => '6',
            'name' => 'Helix Lin',
            'email' => 'hlin@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //7
        $this->People->create();
        $this->People->save(array(
            'id' => '7',
            'name' => 'Ivan Jiang',
            'email' => 'ijiang@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //8
        $this->People->create();
        $this->People->save(array(
            'id' => '8',
            'name' => 'Jakarta Xie',
            'email' => 'jxie@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //9
        $this->People->create();
        $this->People->save(array(
            'id' => '9',
            'name' => 'James Liang',
            'email' => 'jliang@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //10
        $this->People->create();
        $this->People->save(array(
            'id' => '10',
            'name' => 'Jessica Huang',
            'email' => 'jhuang@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //11
        $this->People->create();
        $this->People->save(array(
            'id' => '11',
            'name' => '@@John Fu',
            'email' => 'jfu@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //12
        $this->People->create();
        $this->People->save(array(
            'id' => '12',
            'name' => 'Justin Xu',
            'email' => 'jxu2@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //13
        $this->People->create();
        $this->People->save(array(
            'id' => '13',
            'name' => 'Leakey Tao',
            'email' => 'ltao@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //14
        $this->People->create();
        $this->People->save(array(
            'id' => '14',
            'name' => 'Maggie Ha',
            'email' => 'mha@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //15
        $this->People->create();
        $this->People->save(array(
            'id' => '15',
            'name' => 'Mary Wang',
            'email' => 'mwang@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //16
        $this->People->create();
        $this->People->save(array(
            'id' => '16',
            'name' => 'Michael Chen',
            'email' => 'mchen@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //17
        $this->People->create();
        $this->People->save(array(
            'id' => '17',
            'name' => 'Mira Chu',
            'email' => 'mchu@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //18
        $this->People->create();
        $this->People->save(array(
            'id' => '18',
            'name' => '@@Mike Wang',
            'email' => '',
            'password' => '',
            'admin' => '0'
        ));

        //19
        $this->People->create();
        $this->People->save(array(
            'id' => '19',
            'name' => 'Muffy Ma',
            'email' => 'mma2@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //20
        $this->People->create();
        $this->People->save(array(
            'id' => '20',
            'name' => 'Ray Wang',
            'email' => 'rwang@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //21
        $this->People->create();
        $this->People->save(array(
            'id' => '21',
            'name' => 'Roger Li',
            'email' => 'rli@cdcsoftware.com',
            'password' => '827ccb0eea8a706c4c34a16891f84e7b',
            'admin' => '11'
        ));

        //22
        $this->People->create();
        $this->People->save(array(
            'id' => '22',
            'name' => 'Sarah Shen',
            'email' => 'sshen2@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //23
        $this->People->create();
        $this->People->save(array(
            'id' => '23',
            'name' => '@@Silva Xia',
            'email' => 'sxia@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //24
        $this->People->create();
        $this->People->save(array(
            'id' => '24',
            'name' => 'Wendy Zhao',
            'email' => 'wzhao@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //25
        $this->People->create();
        $this->People->save(array(
            'id' => '25',
            'name' => 'Yves Long',
            'email' => 'ylong@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //26
        $this->People->create();
        $this->People->save(array(
            'id' => '26',
            'name' => 'John Duan',
            'email' => 'jduan@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //27
        $this->People->create();
        $this->People->save(array(
            'id' => '27',
            'name' => 'Michelle Xiao',
            'email' => 'mxiao@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //28
        $this->People->create();
        $this->People->save(array(
            'id' => '28',
            'name' => 'James Lou',
            'email' => '',
            'password' => '',
            'admin' => '0'
        ));

        //29
        $this->People->create();
        $this->People->save(array(
            'id' => '29',
            'name' => 'Vivi Zhou',
            'email' => 'vzhou@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //30
        $this->People->create();
        $this->People->save(array(
            'id' => '30',
            'name' => 'Vivi Zhou',
            'email' => 'vzhou@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //31
        $this->People->create();
        $this->People->save(array(
            'id' => '31',
            'name' => 'Dinga Du',
            'email' => 'ddu@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //32
        $this->People->create();
        $this->People->save(array(
			'id' => '32',
            'name' => 'Jasmine Tang',
            'email' => 'jtang@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        //33
        $this->People->create();
        $this->People->save(array(
			'id' => '33',
            'name' => 'Daisy Wu',
            'email' => 'dwu@cdcsoftware.com',
            'password' => '',
            'admin' => '0'
        ));

        $this->People->del('11', false);
        $this->People->del('18', false);
        $this->People->del('23', false);
        $this->People->del('30', false);
        $this->People->del('20', false);
        $this->People->del('14', false);
    }

    function initOrder(){
        if(!$this->Session->read('islogin'))
        {
            $this->redirect('/admin');
            exit(0);
        }

        $this->redirect('/');
        exit(0);

        $this->set('isLogin', 1);

        $this->Order->deleteAll(array(
            '1' => '1'
        ));
    }
}
?>
